/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../app/bower_components/jquery-ui/themes/base/all.css';
@import '../../app/bower_components/bootstrap/less/bootstrap';
@import '../../app/bower_components/font-awesome/less/font-awesome';

html {
  overflow-y: auto;
}

a {
  cursor: pointer;
}

.container,
.jobs-container {
  width: 100%;
}

.jobs-container {
  margin-top: 20px;
}


.icon-remove-sign {
  color: #FF4B4B;
}

.hidden {
  display: none;
  visibility: hidden;
}

.box {
  border: 1px solid #D4D4D4;
  margin-bottom: 20px;

  .box-header {
    border-bottom: 1px solid #D4D4D4;
  }
  .box-header,
  .box-footer {
    padding: 4px 4px 4px 10px;
    background: #f5f5f5;
  }
  .box-header:after,
  .box-footer:after {
    content: "";
    display: table;
    clear: both;
  }
  .box-header {
    .btn-group {
      float: right;
    }
    h4 {
      float: left;
      margin: 5px;
      font-size: 15px;
      color: #777;
    }
  }
  .box-footer {
    hr {
      margin: 0px;
    }
  }
}


#jobs {

  .jobs-type {
    float: right;
    margin-top: -24px;
  }

  .new-jobs-link {
    float: left;
    margin-left: 496px;
    margin-top: -20px;
  }

  #filtered-jobs {
    float: left;
    margin-top: 8px;
  }

  .jobs_head {
    height: 30px;
  }

  .page-bar {
    border: 1px solid #E4E4E4;
    color: #7B7B7B;
    text-align: right;
    font-size: 12px;
    label {
      font-size: 12px;
    }
    div {
      display: inline-block;
      margin: 0 10px;
    }
    .items-on-page {
      label {
        display: inline;
      }
      select {
        margin-bottom: 4px;
        margin-top: 4px;
        width: 70px;
        font-size: 12px;
        height: 27px;
      }
    }

    .paging_two_button {
      a {
        padding: 0 5px;
      }
      a.paginate_disabled_next, a.paginate_disabled_previous {
        color: gray;
        &:hover i {
          color: gray;
          text-decoration: none;
          cursor: default;
        }
      }

      a.paginate_next, a.paginate_previous {
        &:hover {
          text-decoration: none;
          cursor: pointer;
        }
      }
    }
  }

  #jobs-table {

    .is-not-link {
      cursor: default;
      color: #000000;
      text-decoration: none;
    }

    .apply-btn {
      font-size: 12px;
      padding: 0px 8px;
      margin-top: -8px;
      line-height: 22px;
    }

    .input-120 {
      width: 120px;
    }

    .label-row {
      font-size: 0.9em;
      th {
        padding: 4px 4px 4px 8px;
      }
      .active-sort {
        color: #555555;
        text-decoration: none;
        background-color: #e5e5e5;
        -webkit-box-shadow: inset 0 5px 8px rgba(0, 0, 0, 0.100);
        -moz-box-shadow: inset 0 5px 8px rgba(0, 0, 0, 0.100);
        box-shadow: inset 0 5px 8px rgba(0, 0, 0, 0.100);
      }
    }
    thead {
      background: none repeat scroll 0 0 #F8F8F8;
    }
    #filter-row {
      th {
        padding: 0px;
        padding-left: 8px;
      }
      .active-filter {
        color: #555555;
        text-decoration: none;
        background-color: #e5e5e5;
        -webkit-box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.05);
        -moz-box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.05);
        box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.05);
      }
      input {
        font-size: 12px;
        height: 14px;
      }
      select {
        height: 27px;
        font-size: 12px;
      }
      .start-time a.ui-icon-circle-close {
        margin-top: 7px;
      }
      .filter-btn {
        color: #999999;
        font-size: 12px;
        line-height: 14px;
        padding-left: 6px;
        text-align: left;
        width: 100px;
        .icon-filter {
          color: #999999;
        }
      }
    }
    th {
      border-top: none;
    }
    th, td {
      border-left-width: 0;
    }
    .no-data {
      text-align: center;
    }
    a.job-link {
      width: 100%;
      overflow: auto;
      word-wrap: break-word;
      display: inline-block;
    }
    .tooltip-inner {
      text-align: left;
      max-width: 400px !important;
    }
    td:first-child,
    th:first-child {
      border-left-width: 1px;
      width: 14px;
    }
    td:first-child + td,
    th:first-child + th {
      width: 36%;
    }
    td:first-child + td + td,
    th:first-child + th + th {
      width: 20%;
    }
    td:first-child + td + td + td,
    th:first-child + th + th + th,
    td:first-child + td + td + td + td,
    th:first-child + th + th + th + th {
      width: 16%;
    }
    td:first-child + td + td + td + td + td,
    th:first-child + th + th + th + th + th {
      width: 12%;
    }
  }
  .table {
    table-layout: fixed;
    th {
      border-top: none;
    }
    ul.filter-components {
      padding: 5px 0;
      background: #777777;
      color: #ffffff;
      font-weight: normal;
      font-size: 12px;
      label {
        font-size: 12px;
      }
      li {
        display: block;
        padding: 3px 0 3px 5px;
        line-height: 20px;
        label.checkbox {
          padding-left: 3px;
        }
        input[type="checkbox"] {
          margin: 4px 4px 2px 2px;
        }
      }
      li#title-bar {
        text-align: left;
        border-bottom: 1px solid #e4e4e4;
        a.close {
          background: #777777;
          display: inline;
          color: #ffffff;
          padding-left: 35px;
          padding-right: 12px;
          text-shadow: 0 1px 0 #ffffff;
          float: none;
          font-size: 10px;
          opacity: 0.6;
        }
        a.close:hover {
          background: #777777;
          opacity: 1.0;
        }
      }
      li#selector-bar {
        text-align: left;
        border-bottom: 1px solid #e4e4e4;
        font-size: 6px;
      }
      li#list-area {
        font-weight: normal;
        text-align: left;
      }
      li#button-bar {
        text-align: center;
        button {
          font-size: 12px;
        }
      }
      ul {
        margin-left: 10px;
      }
      &>li {
        &>ul {
          height: 150px;
          margin-left: 0;
          overflow-y: scroll;
        }
      }
    }

    .sorting_asc {
      background: url() no-repeat right 50%;
    }
    .sorting_desc {
      background: url() no-repeat right 50%;
    }
    .sorting {
      background: url() no-repeat right 50%;
    }
    div.view-wrapper {
      input[type="checkbox"], .btn-group {
        margin-bottom: 9px;
      }
    }

    a.ui-icon-circle-close {
      float: right;
      opacity: 0.2;
      padding: 1px 0;
      position: relative;
      right: 0px;
      margin-top: 3px;
      z-index: 10;
      &:hover {
        opacity: 0.7;
      }
    }
    .notActive {
      a.ui-icon-circle-close {
        visibility: hidden;
      }
    }
  }
}

.sort-wrapper {
  .column-name {
    cursor: pointer;
    padding-right: 18px;
  }
}

.help-inline {
  color: #b94a48;
}

#hive-job-details {
  #toggle-query {
    margin-left: 20px;
  }
  .query-info {
    display: none;
    margin-top: 10px;
  }
  #job-more-details-table {
    td {
      vertical-align: top;
    }
    td:first-child {
      font-weight: bold;
      padding-right: 7px;
    }
    a {
      cursor: pointer;
    }
  }
  .sections {
    margin-top: 10px;
  }
  #tez-vertices-table-section {
    display: block;
  }
  #tez-vertices-table-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 7px;
    border-bottom: 1px solid #dddddd;
    border-top: 1px solid #dddddd;
    border-radius: 4px;
    table {
      margin-bottom: 0px;
      .sorting_asc {
        background: url() no-repeat right 50%;
      }
      .sorting_desc {
        background: url() no-repeat right 50%;
      }
      .sorting {
        background: url() no-repeat right 50%;
      }
    }
  }
  #tez-vertex-details-section-body {
    td {
      border-top: none;
    }
    tr td:first-child {
      font-weight: bold;
      width: 20%;
      overflow: auto;
    }
    textarea {
      width: 95%;
      margin-left: 10px;
    }
  }
}

/***************
 * Tez DAG section
 ***************/
#tez-dag-section {
  padding-left: 7px;
  padding-top: 5px;
  overflow: hidden;
  #tez-dag-section-top-bar-actions {
    margin-right: 7px;
  }
}

#tez-dag-section-body {
  display: block;
}

#tez-dag-section-body-dag {
  overflow-y: hidden;

  .heat-0-20 {
    fill: #ffffff;
  }
  .heat-20-40 {
    fill: #aaaaaa;
  }
  .heat-40-60 {
    fill: #ffff00;
  }
  .heat-60-80 {
    fill: #FFC000;
  }
  .heat-80-100 {
    fill: #ff0000;
  }
  .heat-none {
    fill: #999999;
  }
  #tez-dag-svg {
    .link line {
      stroke: #696969;
    }
    .link line.separator {
      stroke: #fff;
      stroke-width: 2px;
    }
    text {
      font-weight: lighter;
    }
    .tez-root-rect {
      fill: white;
      stroke: white;
      opacity: 0;
      stroke-opacity: 0;
    }
    .debug {
      fill: green;
      opacity: 0.2;
    }
    .node {
      .background.map {
        fill: #fde0dd;
        stroke: #bbbbbb;
      }
      .background.reduce {
        fill: #DBD4EB;
        stroke: #bbbbbb;
      }
      .background.union {
        fill: #BCE6DD;
        stroke: #bbbbbb;
      }
      .background.unknown-vertex-type {
        fill: #EBE8CC;
        stroke: #bbbbbb;
      }
      .background.selected {
        stroke: #3a87ad;
      }
      .background {
        stroke-width: 6px;
        fill: #c0c0c0;
        stroke: #999999;
        cursor: pointer;
      }
      .metric {
        rect {
          opacity: 0.6;
        }
        text {
          font-size: 90%;
        }
      }
      .operation {
        fill: #3F66E8;
        opacity: 0.5;
        cursor: pointer;
        text {
          font-size: 80%;
        }
      }
      .vertex-icon-text {
        stroke-width: 0;
        opacity: 0.9;
      }
      .vertex-icon-rect {
        opacity: 0;
      }
      .vertex-icon-text.running,
      .vertex-icon-text.initializing,
      .vertex-icon-text.succeeded,
      .vertex-icon-text.inited {
        fill: green;
        stroke: green;
      }
      .vertex-icon-text.new {
        fill: #fde0dd;
        stroke: cornflowerblue;
        stroke-width: 1;
      }
      .vertex-icon-text.failed,
      .vertex-icon-text.killed,
      .vertex-icon-text.error,
      .vertex-icon-text.terminating {
        fill: red;
        stroke: red;
      }
    }
    .node text {
      pointer-events: none;
    }
    path.link {
      fill: none;
      stroke: #666;
      stroke-width: 5px;
      opacity: 0.6;
    }
    path.link.type-broadcast {
      stroke: teal;
    }
    path.link.type-scatter_gather {
      stroke: orange;
      stroke-dasharray: 10, 3;
    }
    path.link.type-contains {
      stroke: green;
      stroke-dasharray: 10, 2, 5, 2;
    }
    path.link.type-unknown {
      stroke: gray;
    }
  }
}

#hover-op-table {
  margin-bottom: 2px;
  td {
    padding: 2px;
    word-wrap: break-word;
  }
}

#hive-job-details {
  #operator-table {
    td {
      border-top: 1px solid #dddddd;
    }
    tr td:first-child {
      width: 20%;
      overflow: auto;
    }
    td:first-child + td,
    th:first-child + th {
      width: 80%;
    }
  }
}

.alert-info {
  background-color: #E6F1F6;
  border-color: #D2D9DD;
  color: #4E575B;
  text-shadow: none;
  .link {
    padding: 0 15px;
  }
  .link-left-pad {
    padding-left:15px;
  }
}